package edu.neu.swc.cloud.service.impl;

import edu.neu.swc.cloud.dao.FactoryDao;
import edu.neu.swc.cloud.domain.Factory;
import edu.neu.swc.cloud.service.FactoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("factoryService")
public class FactoryServiceImpl implements FactoryService {

    @Autowired
    FactoryDao factoryDao;

    @Override
    public List<Factory> findAll() {
        return factoryDao.findAll();
    }

    @Override
    public void shutDownById(int fac_id) {
        factoryDao.shutDownById(fac_id);
    }

    @Override
    public void startUpById(int fac_id) {
        factoryDao.startUpById(fac_id);
    }

    @Override
    public List<Factory> findFacByCon(Factory factory) {
        return factoryDao.findFacByCon(factory);
    }

    @Override
    public Factory findFacById(int fac_id) {
        return factoryDao.findFacById(fac_id);
    }

    @Override
    public int getFactoryCounts(String s) {
        return factoryDao.getFactoryCounts(s);
    }

    @Override
    public List<Factory> findFactoryByQuery(String s, int pageStart, int pageSize) {
        return factoryDao.findFactoryByQuery(s,pageStart,pageSize);
    }
}
